<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('文件下载列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <h4 class="form-header h4" title="排队中">排队中</h4>
                <table id="exec-table"></table>
                <h4 class="form-header h4" title="已生成文件">已生成文件</h4>
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('base:download:edit')}]];
        var removeFlag = [[${@permission.hasPermi('base:download:remove')}]];
        var prefix = ctx + "base/download";
        var menuId = [[${menuId}]];
        $(function() {
            var options = {
                url: prefix + "/list",
                removeUrl: prefix + "/remove",
                modalName: "文件下载",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'idDownload',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'naFile',
                    title: '文件名'
                },
                {
                    field: 'des',
                    title: '备注'
                },
                {
                    field: 'naEmpCre',
                    title: '创建人'
                },
                {
                    field: 'dtEmpCre',
                    title: '创建时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.idDownload + '\')"><i class="fa fa-edit"></i>下载</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.idDownload + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
            $("#exec-table").bootstrapTable({
                pagination: false,
                showRefresh: true,
                method: 'post',
                url:prefix+'/queue/list',
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'idDownload',
                        title: '主键',
                        visible: false
                    },
                    {
                        field: 'menuName',
                        title: '菜单名称'
                    },
                    {
                        field: 'fileName',
                        title: '文件名'
                    },
                    {
                        field: 'des',
                        title: '备注'
                    },
                    {
                        field: 'userName',
                        title: '创建人'
                    },
                    {
                        field: 'dtSysCre',
                        title: '创建时间'
                    }]
            });
        });
    </script>
</body>
</html>